﻿package com.mini.framework.bi.bpull.model;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * 曲线图数据对象
 * 
 * @author lishsh
 * 
 */
public class Line {

	private String x;

	private String value;

	private String value2;

	private String value3;

	private String over;

	private Integer emphasize;

	public String getX() {
		return x;
	}

	public void setX(String x) {
		if(isSunDay(x)){
			this.setEmphasize(new Integer(1));
		}else{
			this.setEmphasize(new Integer(0));
		}
		this.x = x;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getValue2() {
		return value2;
	}

	public void setValue2(String value2) {
		this.value2 = value2;
	}

	public String getOver() {
		return over;
	}

	public void setOver(String over) {
		this.over = over;
	}

	public String getValue3() {
		return value3;
	}

	public void setValue3(String value3) {
		this.value3 = value3;
	}

	public Integer getEmphasize() {
		return emphasize;
	}

	public void setEmphasize(Integer emphasize) {
		this.emphasize = emphasize;
	}

	public boolean isSunDay(String day) {
		boolean isSun = false;
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		try {
			Date myDate = sdf.parse(day);
			Calendar myCalendar = Calendar.getInstance();
			myCalendar.setTime(myDate);
			int i = myCalendar.get(Calendar.DAY_OF_WEEK);
			if (i == 1 || i == 7){
				isSun = true;
			}
		} catch (Exception ex) {
			System.out.println("Err ");
		}
		return isSun;
	}
	
	

}
